Adjust time struct before mkgmtime/mktime when date/time buffer doesn't have a date.
authoroliskoli <oliskoli>
Tue, 5 Jun 2007 20:54:40 +0000 (20:54 +0000)
committeroliskoli <oliskoli>
Tue, 5 Jun 2007 20:54:40 +0000 (20:54 +0000)
csv_util.c

index d3e760abf7a99c71fc9e24c38bd4361ac5fa1ed8..ab559378e3f70d5f2b97c4e6e3f441d69658c94f 100644 (file)
@@ -683,6 +683,11 @@ sscanftime( const char *s, const char *format, const int gmt )
 
        if ( strptime( s, format, &stm ) )
        {
+               if ((stm.tm_mday == 0) && (stm.tm_mon == 0) && (stm.tm_year == 0)) {
+                       stm.tm_mday = 1;
+                       stm.tm_mon = 0;
+                       stm.tm_year = 70;
+               }
                stm.tm_isdst = -1;
                if (gmt)
                        return mkgmtime(&stm);